<?php 
session_start();
ob_start();
include_once ('include/conn.php');
$smarty->assign("Title", "系统消息");
?>
<?php
if (!isset($_SESSION)) {
  session_start();
};
$smarty->display('meta.tpl');

?>
<div id="coverDiv" align="center">
<?
$smarty->display('mean.tpl');
?>
<div id="mainDiv" class="k-main">

	<div style="float:left;" class="k-message" >
<br><br><br><br><br><br><br><br><br>


<?php
$errorcode = $_GET["msg"];
switch ($errorcode){
case "exit": {
		$_SESSION['MM_Username'] = NULL;
		unset($_SESSION['MM_Username']);
		setcookie("username","");
		setcookie("password","");
?><br />
您已成功登出，欢迎再次光临开味网。<br /><br /><br />

3秒后将跳转到首页
    <script type="text/javascript">
    <!--
    var duration=3900;
    var timer=null;
    var endTime = new Date().getTime() + duration + 100;
    function interval()
    {
        var n=(endTime-new Date().getTime())/1000;
        if(n<0) return;

        setTimeout(interval, 10);
    }

    window.onload=function()
    {
        timer=setTimeout("window.location.href='index.php'", duration);
        interval();
    }
    //-->
    </script> 
<? }
break;

//账号/密码错误 -->
case "error": { ?>
对不起，账号或是密码填写错误。<br />
请重新确认或是联系客服。<br />
3秒后将回到登陆页面<br />
<br />
<span onclick="window.location.href='login.htm'">点击这里立即跳转</span></p>
        <p>
          <script type="text/javascript">
    <!--
    var duration=3900;
    var timer=null;
    var endTime = new Date().getTime() + duration + 100;
    function interval()
    {
        var n=(endTime-new Date().getTime())/1000;
        if(n<0) return;

        setTimeout(interval, 10);
    }
	    function Jump()
    {
        clearTimeout(timer);

    }
    window.onload=function()
    {
        timer=setTimeout("window.location.href='login.htm'", duration);
        interval();
    }
    //-->
          </script> 
          <? }
break;
//用户登陆 -->
case "loginsuccess": { ?><br />
欢迎您登陆开味网，<?php echo $_SESSION['MM_Username'];
	setcookie('username', base64_encode($_SESSION['MM_Username']), time()+3600);
	setcookie('password', base64_encode($_SESSION['MM_Password']), time()+3600);
?>
。<br />
<br />
3秒后将跳转到之前的页面<br />
<br />
<span onclick="history.go(-3)">点击这里立即跳转</span></p>
        <p>
          <script type="text/javascript">
    <!--
    var duration=3900;
    var timer=null;
    var endTime = new Date().getTime() + duration + 100;
    function interval()
    {
        var n=(endTime-new Date().getTime())/1000;
        if(n<0) return;

        setTimeout(interval, 10);
    }
	    function Jump()
    {
        clearTimeout(timer);

    }
    window.onload=function()
    {
        timer=setTimeout("history.go(-3)", duration);
        interval();
    }
    //-->
          </script> 
          <? }
break;

case "nologin": {
/*if ( (isset($_COOKIE['sdkjlfwe']) && isset($_COOKIE['username'])) || isset($_SESSION['MM_Username']) )
{
echo "<script>location.href='list.php'</script>";
}else{*/ ?><br /><br />
您还没有登陆，请先登录后再访问本页面<br /><br /><br />
<a href="login.php" >点击这里开始登陆</a></span>
<? }

break;
case "logend": {
	echo base64_decode($_COOKIE['username']).'<br/>';
	?><br />

您已成功是登陆状态了，不需要重复登陆。<br /><br />
3秒后将跳转到注册页面
    <script type="text/javascript">
    <!--
    var duration=3900;
    var timer=null;
    var endTime = new Date().getTime() + duration + 100;
    function interval()
    {
        var n=(endTime-new Date().getTime())/1000;
        if(n<0) return;

        setTimeout(interval, 10);
    }

    window.onload=function()
    {
        timer=setTimeout("window.location.href='reguser.php'", duration);
        interval();
    }
    //-->
    </script> 
<? }
break;

case "regsuccess": { ?><br /><br />
注册成功!现在将进入首页.<br /><br /><br />
3秒后将跳转到首页
    <script type="text/javascript">
    <!--
    var duration=3900;
    var timer=null;
    var endTime = new Date().getTime() + duration + 100;
    function interval()
    {
        var n=(endTime-new Date().getTime())/1000;
        if(n<0) return;

        setTimeout(interval, 10);
    }

    window.onload=function()
    {
        timer=setTimeout("window.location.href='index.php'", duration);
        interval();
    }
    //-->
    </script> 
<? }
break;

case "cookies": { ?>
          <br />
          <br />
          欢迎您登陆开味网，<?php echo $_SESSION['MM_Username'];
if (isset($_COOKIE['sdkjlfwe']) && isset($_COOKIE['user'])) {
} else {
setcookie("username",$_SESSION['MM_Username'],time()+3600*24*7);
setcookie("sdkjlfwe",$_SESSION['MM_Password'],time()+3600*24*7);
}?> 。<br />
          <br />
          <br />
          3秒后将跳转到首页
          <script type="text/javascript">
    <!--
    var duration=3900;
    var timer=null;
    var endTime = new Date().getTime() + duration + 100;
    function interval()
    {
        var n=(endTime-new Date().getTime())/1000;
        if(n<0) return;
        document.getElementById("timeout").innerHTML = n.toFixed(3);
        setTimeout(interval, 10);
    }

    window.onload=function()
    {
        timer=setTimeout("window.location.href='index.php'", duration);
        interval();
    }
    //-->
          </script> 
          <? }
break;
case "booksuccess":{
?>
          订餐成功!</p>
        <p>您所订购外卖将在<? echo $_GET[eattime] ?>送到您手中！</p>
        <p>您可以在[<a href="list.php">查看订单</a>]页面评价或是删除这份订单<br />
        </p>
        <p><a href="http://sighttp.qq.com/cgi-bin/check?sigkey=e73ed27177c565f1bdddb2ce80b5cf1f463bce4059263b69d27467d974592411"; target=_blank; onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=e73ed27177c565f1bdddb2ce80b5cf1f463bce4059263b69d27467d974592411';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;"><img border="0" SRC='http://wpa.qq.com/pa?p=1:1121595591:4'></a> 其他问题请联系客服
<? break;
}
}
?>      

	</div>

</div>
</div>
<?php 
$smarty->display('footer.tpl');

?>